﻿//==================================================================
// Copyright (C) 2011 深圳市中旭企业管理股份有限公司
// 文件名: V_CrmValueRpt.cs
// 作 者：代码自动生成
// 日 期：2013-4-15 17:55:53
// 描 述：
// 版 本：1.00
// 修改历史纪录
// 版 本  修改时间      修改人            修改内容
// 1.00             
//==================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using Csla;
using lite;
using Csla.Validation;
using Csla.Data;
using System.Data.SqlClient;
using ZX.DAL;
using OpenExpressApp.ORM;

namespace ZX.CRM.Library
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    [Table(Name = "V_CrmValueRpt")]
    [ZX.DBModule.Table("V_CrmValueRpt", "CustomerName")]
    public class V_CrmValueRpt : ZX.DBModule.BaseEntity
    {
        #region Business Methods 业务方法
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CustomerNameProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CustomerName"));
        [DataObjectField(true, true)]
        [Column, PK]
        public string CustomerName
        {
            get { return GetProperty(CustomerNameProperty); }
            set { SetProperty(CustomerNameProperty, value); }
        }

        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ValueTypeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("ValueType"));
        [Column]
        public string ValueType
        {
            get { return GetProperty(ValueTypeProperty); }
            set { SetProperty(ValueTypeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> cTypeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("cType"));
        [Column]
        public string cType
        {
            get { return GetProperty(cTypeProperty); }
            set { SetProperty(cTypeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CValueProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CValue"));
        [Column]
        public string CValue
        {
            get { return GetProperty(CValueProperty); }
            set { SetProperty(CValueProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> TaskShareProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("TaskShare"));
        [Column]
        public string TaskShare
        {
            get { return GetProperty(TaskShareProperty); }
            set { SetProperty(TaskShareProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> TaskExplainProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("TaskExplain"));
        [Column]
        public string TaskExplain
        {
            get { return GetProperty(TaskExplainProperty); }
            set { SetProperty(TaskExplainProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> DevTypeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("DevType"));
        [Column]
        public string DevType
        {
            get { return GetProperty(DevTypeProperty); }
            set { SetProperty(DevTypeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> DevCustomerNameProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("DevCustomerName"));
        [Column]
        public string DevCustomerName
        {
            get { return GetProperty(DevCustomerNameProperty); }
            set { SetProperty(DevCustomerNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ZjsTypeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("ZjsType"));
        [Column]
        public string ZjsType
        {
            get { return GetProperty(ZjsTypeProperty); }
            set { SetProperty(ZjsTypeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsTrainAgainProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsTrainAgain"));
        [Column]
        public string IsTrainAgain
        {
            get { return GetProperty(IsTrainAgainProperty); }
            set { SetProperty(IsTrainAgainProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> TrainDateAddressProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("TrainDateAddress"));
        [Column]
        public string TrainDateAddress
        {
            get { return GetProperty(TrainDateAddressProperty); }
            set { SetProperty(TrainDateAddressProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsClassSignProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsClassSign"));
        [Column]
        public string IsClassSign
        {
            get { return GetProperty(IsClassSignProperty); }
            set { SetProperty(IsClassSignProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> LastCEOProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("LastCEO"));
        [Column]
        public string LastCEO
        {
            get { return GetProperty(LastCEOProperty); }
            set { SetProperty(LastCEOProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsPayOrderProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsPayOrder"));
        [Column]
        public string IsPayOrder
        {
            get { return GetProperty(IsPayOrderProperty); }
            set { SetProperty(IsPayOrderProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsClassCEOProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsClassCEO"));
        [Column]
        public string IsClassCEO
        {
            get { return GetProperty(IsClassCEOProperty); }
            set { SetProperty(IsClassCEOProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CEODateAddressProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CEODateAddress"));
        [Column]
        public string CEODateAddress
        {
            get { return GetProperty(CEODateAddressProperty); }
            set { SetProperty(CEODateAddressProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsWestPointProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsWestPoint"));
        [Column]
        public string IsWestPoint
        {
            get { return GetProperty(IsWestPointProperty); }
            set { SetProperty(IsWestPointProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsSalonProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsSalon"));
        [Column]
        public string IsSalon
        {
            get { return GetProperty(IsSalonProperty); }
            set { SetProperty(IsSalonProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> UnSignClassReasonProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("UnSignClassReason"));
        [Column]
        public string UnSignClassReason
        {
            get { return GetProperty(UnSignClassReasonProperty); }
            set { SetProperty(UnSignClassReasonProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> EPIsClassSignProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("EPIsClassSign"));
        [Column]
        public string EPIsClassSign
        {
            get { return GetProperty(EPIsClassSignProperty); }
            set { SetProperty(EPIsClassSignProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> EPDateAddressProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("EPDateAddress"));
        [Column]
        public string EPDateAddress
        {
            get { return GetProperty(EPDateAddressProperty); }
            set { SetProperty(EPDateAddressProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> EPClassPayProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("EPClassPay"));
        [Column]
        public string EPClassPay
        {
            get { return GetProperty(EPClassPayProperty); }
            set { SetProperty(EPClassPayProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> EPPayDateProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("EPPayDate"));
        [Column]
        public string EPPayDate
        {
            get { return GetProperty(EPPayDateProperty); }
            set { SetProperty(EPPayDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> EPMoneyProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<decimal>("EPMoney"));
        [Column]
        public decimal EPMoney
        {
            get { return GetProperty(EPMoneyProperty); }
            set { SetProperty(EPMoneyProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> APDateProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<DateTime>("APDate"));
        [Column]
        public DateTime APDate
        {
            get { return GetProperty(APDateProperty); }
            set { SetProperty(APDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> LongDateAddressProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("LongDateAddress"));
        [Column]
        public string LongDateAddress
        {
            get { return GetProperty(LongDateAddressProperty); }
            set { SetProperty(LongDateAddressProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> OrderMoneyProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("OrderMoney"));
        [Column]
        public string OrderMoney
        {
            get { return GetProperty(OrderMoneyProperty); }
            set { SetProperty(OrderMoneyProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> FactTempDateProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("FactTempDate"));
        [Column]
        public string FactTempDate
        {
            get { return GetProperty(FactTempDateProperty); }
            set { SetProperty(FactTempDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> FirstDateProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("FirstDate"));
        [Column]
        public string FirstDate
        {
            get { return GetProperty(FirstDateProperty); }
            set { SetProperty(FirstDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> FirstNumProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("FirstNum"));
        [Column]
        public string FirstNum
        {
            get { return GetProperty(FirstNumProperty); }
            set { SetProperty(FirstNumProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CEOAddressProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CEOAddress"));
        [Column]
        public string CEOAddress
        {
            get { return GetProperty(CEOAddressProperty); }
            set { SetProperty(CEOAddressProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> LastAddressProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("LastAddress"));
        [Column]
        public string LastAddress
        {
            get { return GetProperty(LastAddressProperty); }
            set { SetProperty(LastAddressProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> AddUserProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<Guid>("AddUser"));
        [Column]
        public Guid AddUser
        {
            get { return GetProperty(AddUserProperty); }
            set { SetProperty(AddUserProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkFlowInsIdProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("WorkFlowInsId"));
        [Column]
        public string WorkFlowInsId
        {
            get { return GetProperty(WorkFlowInsIdProperty); }
            set { SetProperty(WorkFlowInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ProductListProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("ProductList"));
        [Column]
        public string ProductList
        {
            get { return GetProperty(ProductListProperty); }
            set { SetProperty(ProductListProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> AmountProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("Amount"));
        [Column]
        public string Amount
        {
            get { return GetProperty(AmountProperty); }
            set { SetProperty(AmountProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CZNameProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CZName"));
        [Column]
        public string CZName
        {
            get { return GetProperty(CZNameProperty); }
            set { SetProperty(CZNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CNameProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CName"));
        [Column]
        public string CName
        {
            get { return GetProperty(CNameProperty); }
            set { SetProperty(CNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CZTelProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CZTel"));
        [Column]
        public string CZTel
        {
            get { return GetProperty(CZTelProperty); }
            set { SetProperty(CZTelProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CTelProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CTel"));
        [Column]
        public string CTel
        {
            get { return GetProperty(CTelProperty); }
            set { SetProperty(CTelProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> AgainBuyDateProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("AgainBuyDate"));
        [Column]
        public string AgainBuyDate
        {
            get { return GetProperty(AgainBuyDateProperty); }
            set { SetProperty(AgainBuyDateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> AgainBuyProductProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("AgainBuyProduct"));
        [Column]
        public string AgainBuyProduct
        {
            get { return GetProperty(AgainBuyProductProperty); }
            set { SetProperty(AgainBuyProductProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> SaleRoadProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("SaleRoad"));
        [Column]
        public string SaleRoad
        {
            get { return GetProperty(SaleRoadProperty); }
            set { SetProperty(SaleRoadProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> DeptNameProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("DeptName"));
        [Column]
        public string DeptName
        {
            get { return GetProperty(DeptNameProperty); }
            set { SetProperty(DeptNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> PayMoneyTotalProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<decimal>("PayMoneyTotal"));
        [Column]
        public decimal PayMoneyTotal
        {
            get { return GetProperty(PayMoneyTotalProperty); }
            set { SetProperty(PayMoneyTotalProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> EXP3Property = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("EXP3"));
        [Column]
        public string EXP3
        {
            get { return GetProperty(EXP3Property); }
            set { SetProperty(EXP3Property, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CodeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("Code"));
        [Column]
        public string Code
        {
            get { return GetProperty(CodeProperty); }
            set { SetProperty(CodeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsFirstSaleProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsFirstSale"));
        [Column]
        public string IsFirstSale
        {
            get { return GetProperty(IsFirstSaleProperty); }
            set { SetProperty(IsFirstSaleProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> DliverStateProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<Guid>("DliverState"));
        [Column]
        public Guid DliverState
        {
            get { return GetProperty(DliverStateProperty); }
            set { SetProperty(DliverStateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> DStateProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("DState"));
        [Column]
        public string DState
        {
            get { return GetProperty(DStateProperty); }
            set { SetProperty(DStateProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkTaskInsIdProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("WorkTaskInsId"));
        [Column]
        public string WorkTaskInsId
        {
            get { return GetProperty(WorkTaskInsIdProperty); }
            set { SetProperty(WorkTaskInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> IDProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<Guid>("ID"));
        [Column]
        public Guid ID
        {
            get { return GetProperty(IDProperty); }
            set { SetProperty(IDProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> AddTimeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<DateTime>("AddTime"));
        [Column]
        public DateTime AddTime
        {
            get { return GetProperty(AddTimeProperty); }
            set { SetProperty(AddTimeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<DateTime> EndTimeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<DateTime>("EndTime"));
        [Column]
        public DateTime EndTime
        {
            get { return GetProperty(EndTimeProperty); }
            set { SetProperty(EndTimeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> CustomeerMgrProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<Guid>("CustomeerMgr"));
        [Column]
        public Guid CustomeerMgr
        {
            get { return GetProperty(CustomeerMgrProperty); }
            set { SetProperty(CustomeerMgrProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> ProjectTypeTextProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("ProjectTypeText"));
        [Column]
        public string ProjectTypeText
        {
            get { return GetProperty(ProjectTypeTextProperty); }
            set { SetProperty(ProjectTypeTextProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> COProjectProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("COProject"));
        [Column]
        public string COProject
        {
            get { return GetProperty(COProjectProperty); }
            set { SetProperty(COProjectProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<decimal> ProjectMoneyProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<decimal>("ProjectMoney"));
        [Column]
        public decimal ProjectMoney
        {
            get { return GetProperty(ProjectMoneyProperty); }
            set { SetProperty(ProjectMoneyProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> OneMoneyProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("OneMoney"));
        [Column]
        public string OneMoney
        {
            get { return GetProperty(OneMoneyProperty); }
            set { SetProperty(OneMoneyProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> IsCOProjectProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("IsCOProject"));
        [Column]
        public string IsCOProject
        {
            get { return GetProperty(IsCOProjectProperty); }
            set { SetProperty(IsCOProjectProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ProjectTypeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<Guid>("ProjectType"));
        [Column]
        public Guid ProjectType
        {
            get { return GetProperty(ProjectTypeProperty); }
            set { SetProperty(ProjectTypeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> EXP4Property = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("EXP4"));
        [Column]
        public string EXP4
        {
            get { return GetProperty(EXP4Property); }
            set { SetProperty(EXP4Property, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CxTimeProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("CxTime"));
        [Column]
        public string CxTime
        {
            get { return GetProperty(CxTimeProperty); }
            set { SetProperty(CxTimeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> PackNameProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("PackName"));
        [Column]
        public string PackName
        {
            get { return GetProperty(PackNameProperty); }
            set { SetProperty(PackNameProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> DevYearProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<string>("DevYear"));
        [Column]
        public string DevYear
        {
            get { return GetProperty(DevYearProperty); }
            set { SetProperty(DevYearProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> ICZNameProperty = RegisterProperty(typeof(V_CrmValueRpt), new PropertyInfo<Guid>("ICZName"));
        [Column]
        public Guid ICZName
        {
            get { return GetProperty(ICZNameProperty); }
            set { SetProperty(ICZNameProperty, value); }
        }
        #endregion

        #region Validation Rules 验证规则
        //将验证规则与业务对象的属性联系在一起
        protected override void AddBusinessRules()
        {
            //AddRule的第一个参数是委托变量，也就是说是方法的变量
            ValidationRules.AddRule(CommonRules.StringRequired, "ValueType");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ValueType", 14));
            ValidationRules.AddRule(CommonRules.StringRequired, "cType");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("cType", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "CValue");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CValue", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "TaskShare");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TaskShare", 1000));
            ValidationRules.AddRule(CommonRules.StringRequired, "TaskExplain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TaskExplain", 1000));
            ValidationRules.AddRule(CommonRules.StringRequired, "DevType");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("DevType", 24));
            ValidationRules.AddRule(CommonRules.StringRequired, "DevCustomerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("DevCustomerName", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "ZjsType");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ZjsType", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsTrainAgain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsTrainAgain", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "TrainDateAddress");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TrainDateAddress", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsClassSign");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsClassSign", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "LastCEO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("LastCEO", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsPayOrder");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsPayOrder", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsClassCEO");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsClassCEO", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "CEODateAddress");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CEODateAddress", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsWestPoint");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsWestPoint", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsSalon");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsSalon", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "UnSignClassReason");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("UnSignClassReason", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "EPIsClassSign");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EPIsClassSign", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "EPDateAddress");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EPDateAddress", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "EPClassPay");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EPClassPay", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "EPPayDate");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EPPayDate", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "LongDateAddress");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("LongDateAddress", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "OrderMoney");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("OrderMoney", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "FactTempDate");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("FactTempDate", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "FirstDate");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("FirstDate", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "FirstNum");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("FirstNum", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "CEOAddress");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CEOAddress", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "LastAddress");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("LastAddress", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkFlowInsId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkFlowInsId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "ProductList");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ProductList", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "Amount");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Amount", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "CZName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CZName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "CName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "CZTel");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CZTel", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "CTel");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CTel", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "AgainBuyDate");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("AgainBuyDate", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "AgainBuyProduct");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("AgainBuyProduct", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "SaleRoad");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SaleRoad", 200));
            ValidationRules.AddRule(CommonRules.StringRequired, "DeptName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("DeptName", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "EXP3");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EXP3", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "Code");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Code", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsFirstSale");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsFirstSale", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "DState");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("DState", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "WorkTaskInsId");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("WorkTaskInsId", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "ProjectTypeText");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ProjectTypeText", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "COProject");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("COProject", 2));
            ValidationRules.AddRule(CommonRules.StringRequired, "OneMoney");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("OneMoney", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsCOProject");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsCOProject", 1));
            ValidationRules.AddRule(CommonRules.StringRequired, "EXP4");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EXP4", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "CxTime");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CxTime", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "PackName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PackName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "DevYear");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("DevYear", 10));
            //base.AddBusinessRules();
        }
        #endregion

        #region Factory Methods 工厂方法

        public V_CrmValueRpt() { }

        public static V_CrmValueRpt New()
        {
            return DataPortal.Create<V_CrmValueRpt>();
        }
        public static V_CrmValueRpt Get(string CustomerName)
        {
            return DataPortal.Fetch<V_CrmValueRpt>(new SingleLazyCriteria<V_CrmValueRpt, string>(CustomerName, false));
        }
        public static void Delete(string CustomerName)
        {
            DataPortal.Delete(CustomerName);
        }

        #endregion

        #region Data Access 数据访问
        //由于DataPortal_create中没有对数据库的访问，所有标记了Runlocal特性，使得该方法只需在本地运行即可
        //如果代码中有访问数据库的方法，那么就不要用这个特性，使数据门户可以根据情况将此方法的运行选择在应用服务器还是本地
        [RunLocal()]
        protected override void DataPortal_Create()
        {
            //在此调用CheckRules对所有的属性进行验证规则的检查，这样检查只运行一次。
            ValidationRules.CheckRules();
        }


        //可以看到此方法没有标记任何特性
        //此方法要访问数据库所以不能标记本地，由于她没有任何数据库更新操作所以也无需事务性的保护
        //此方法调用结束后会隐含的调用MarkOld（）方法
        private void DataPortal_Fetch(string CustomerName)
        {
            //通过连接字符串建立SQL连接对象，Using符号代表，范围释放的意思，SqlConnection对象会在此范围后被释放掉
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(ConnectionStringNames))
            {
                IDb db = DbFactory.Instance.GetDb(ctx.Connection);
                IQuery q = db.Query();
                q.Constrain("CustomerName").Equal(CustomerName);

                var data = db.Select<V_CrmValueRpt>(q)[0];
                LoadProperty(CustomerNameProperty, data.CustomerName);
                LoadProperty(ValueTypeProperty, data.ValueType);
                LoadProperty(cTypeProperty, data.cType);
                LoadProperty(CValueProperty, data.CValue);
                LoadProperty(TaskShareProperty, data.TaskShare);
                LoadProperty(TaskExplainProperty, data.TaskExplain);
                LoadProperty(DevTypeProperty, data.DevType);
                LoadProperty(DevCustomerNameProperty, data.DevCustomerName);
                LoadProperty(ZjsTypeProperty, data.ZjsType);
                LoadProperty(IsTrainAgainProperty, data.IsTrainAgain);
                LoadProperty(TrainDateAddressProperty, data.TrainDateAddress);
                LoadProperty(IsClassSignProperty, data.IsClassSign);
                LoadProperty(LastCEOProperty, data.LastCEO);
                LoadProperty(IsPayOrderProperty, data.IsPayOrder);
                LoadProperty(IsClassCEOProperty, data.IsClassCEO);
                LoadProperty(CEODateAddressProperty, data.CEODateAddress);
                LoadProperty(IsWestPointProperty, data.IsWestPoint);
                LoadProperty(IsSalonProperty, data.IsSalon);
                LoadProperty(UnSignClassReasonProperty, data.UnSignClassReason);
                LoadProperty(EPIsClassSignProperty, data.EPIsClassSign);
                LoadProperty(EPDateAddressProperty, data.EPDateAddress);
                LoadProperty(EPClassPayProperty, data.EPClassPay);
                LoadProperty(EPPayDateProperty, data.EPPayDate);
                LoadProperty(EPMoneyProperty, data.EPMoney);
                LoadProperty(APDateProperty, data.APDate);
                LoadProperty(LongDateAddressProperty, data.LongDateAddress);
                LoadProperty(OrderMoneyProperty, data.OrderMoney);
                LoadProperty(FactTempDateProperty, data.FactTempDate);
                LoadProperty(FirstDateProperty, data.FirstDate);
                LoadProperty(FirstNumProperty, data.FirstNum);
                LoadProperty(CEOAddressProperty, data.CEOAddress);
                LoadProperty(LastAddressProperty, data.LastAddress);
                LoadProperty(AddUserProperty, data.AddUser);
                LoadProperty(WorkFlowInsIdProperty, data.WorkFlowInsId);
                LoadProperty(ProductListProperty, data.ProductList);
                LoadProperty(AmountProperty, data.Amount);
                LoadProperty(CZNameProperty, data.CZName);
                LoadProperty(CNameProperty, data.CName);
                LoadProperty(CZTelProperty, data.CZTel);
                LoadProperty(CTelProperty, data.CTel);
                LoadProperty(AgainBuyDateProperty, data.AgainBuyDate);
                LoadProperty(AgainBuyProductProperty, data.AgainBuyProduct);
                LoadProperty(SaleRoadProperty, data.SaleRoad);
                LoadProperty(DeptNameProperty, data.DeptName);
                LoadProperty(PayMoneyTotalProperty, data.PayMoneyTotal);
                LoadProperty(EXP3Property, data.EXP3);
                LoadProperty(CodeProperty, data.Code);
                LoadProperty(IsFirstSaleProperty, data.IsFirstSale);
                LoadProperty(DliverStateProperty, data.DliverState);
                LoadProperty(DStateProperty, data.DState);
                LoadProperty(WorkTaskInsIdProperty, data.WorkTaskInsId);
                LoadProperty(IDProperty, data.ID);
                LoadProperty(AddTimeProperty, data.AddTime);
                LoadProperty(EndTimeProperty, data.EndTime);
                LoadProperty(CustomeerMgrProperty, data.CustomeerMgr);
                LoadProperty(ProjectTypeTextProperty, data.ProjectTypeText);
                LoadProperty(COProjectProperty, data.COProject);
                LoadProperty(ProjectMoneyProperty, data.ProjectMoney);
                LoadProperty(OneMoneyProperty, data.OneMoney);
                LoadProperty(IsCOProjectProperty, data.IsCOProject);
                LoadProperty(ProjectTypeProperty, data.ProjectType);
                LoadProperty(EXP4Property, data.EXP4);
                LoadProperty(CxTimeProperty, data.CxTime);
                LoadProperty(PackNameProperty, data.PackName);
                LoadProperty(DevYearProperty, data.DevYear);
                LoadProperty(ICZNameProperty, data.ICZName);
            }
        }

        [Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_DeleteSelf()
        {
            //依然是调用下面的方法删除的，只是他此时可以获得自己的Id
            DataPortal_Delete(CustomerNameProperty);
        }
        #endregion
    }
}

